<?php
include_once('common/header.php');	
if($AppUI->id <= 0 || !isset($_SERVER['HTTP_REFERER'])) {	
	$arrJson = array('error'=>1,'msg'=>$arrError[1]);
	echo $objRequest->getParam('callback') . '(' . Zend_Json::encode($arrJson) . ')';
	exit();
}
$intOfflineId	= $objRequest->getParam('offlineid', 0);
$intType		= $objRequest->getParam('type', 0);
$intOjoinId		= $objRequest->getParam('ojoinid', 0);
$intUserId		= Vfriend_Function::base64D($objRequest->getParam('uid', 0));
$intError		= 0;
$objOffline		= new Offline();
$arrRow			= $objOffline->get($intOfflineId);
$arrOjoin		= $objOffline->getOjoin($intUserId, $intOfflineId);
if( isset($arrOjoin['statuses']) && abs($arrOjoin['statuses']) < 2 && isset($arrRow) && $AppUI->id == $arrRow['userid']) {
	$this->view->intType 		= $intType;
	$this->view->intOfflineId 	= $intOfflineId;
	$this->view->row 			= $arrRow;
	$this->view->intUserId 		= $intUserId;
	$this->view->intOjoinId 	= $intOjoinId;
	$objView 	= Zend_Registry::get('objView');
	$strData	= $objView->fetch('ajax/ui-offline-denied.tpl');
} else {
	$intError	= 1;
	$strData	= $arrError[1];
}
$arrJson 		= array('error'=>$intError,'msg'=>$strData);
echo $objRequest->getParam('callback') . '(' . Zend_Json::encode($arrJson) . ')';
exit();
?>